package FlowGraph.Nodes;

import antlr.collections.AST;


import FlowGraph.FlowGraphNode;
import FlowGraph.StatementInfo.StatementInfo;

//////////////////////////////////////////////////////////////////////////
//// DoConditionNode
/**

@author Ivan Jeukens
@version v 0.1 03/10/2001
*/
public class DoConditionNode extends FlowGraphNode {

    public DoConditionNode(AST statement) {
        super(statement, DO_CONDITION, 1, 2);
        _condition = statement.getFirstChild();
        _condition = _condition.getNextSibling();

        _conditionInfo = new StatementInfo(this, _condition);
    }
    
    ///////////////////////////////////////////////////////////////////
    ////                        public methods                     ////

    public FlowGraphNode getContinueNode() {
        return getOutputNode(0);
    }

    public FlowGraphNode getExitNode() {
        return getOutputNode(1);
    }

    public String toString() {
        return new String("do...while(" + ")");
    }

    public AST getCondition() {
        return _condition;
    }

    public StatementInfo getStatementInfo() {
        return _conditionInfo;
    }

    ///////////////////////////////////////////////////////////////////
    ////                      private variables                    ////

    private AST _condition;
    private StatementInfo _conditionInfo;
}
